package com.leanyuan.check.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leanyuan.check.dao.InspectionMapper_C;
import com.leanyuan.check.domain.Inspection;
import com.leanyuan.check.dto.Inspectiondto;
import com.leanyuan.check.service.InspectionService_C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 相亲相爱一家人
 * @since 2021-05-25
 */
@Service
public class InspectionServiceCImpl_C extends ServiceImpl<InspectionMapper_C, Inspection> implements InspectionService_C {

    @Autowired
    InspectionMapper_C inspectionMapperC;

    @Override
    public Page<Inspectiondto> InspectiondtolistPage(Integer page, Integer size) {
        Page<Inspectiondto> pages = new Page<Inspectiondto>(page, size);
        // baseMapper就是指代的TbSampleMapper类。
        return this.inspectionMapperC.selectSamplePageVoPage(pages, null,null,"%%");
    }

    @Override
    public Page<Inspectiondto> InspectiondtolistPage1(Integer page, Integer size, Integer id,String type, String inspection) {
        // 构造分页参数
        Page<Inspectiondto> pages = new Page<Inspectiondto>(page, size);
        // baseMapper就是指代的TbSampleMapper类。
        String inspection1="%"+inspection+"%";
        return this.inspectionMapperC.selectSamplePageVoPage(pages, id,type,inspection1);
    }

    @Override
    public List<Inspection> selectInspection(){
        return inspectionMapperC.selectInspection();
    }
}
